<?php
use think\facade\Route;

// Category
Route::group("v1/blog", function () {
    // 前台查看所以的Category
    Route::group(function () {
        Route::get('getAllCategory', 'getAllCategory');
    })->prefix('\app\blog\controller\v1\Category@');
});

// Article
Route::group("v1/blog", function () {
    // 获取文章列表(支持分页)
    Route::group(function () {
        Route::post('getArticleList', 'getArticleList');
    })->prefix('\app\blog\controller\v1\Article@');
    // 获取文章详情
    Route::group(function () {
        Route::get('getArticle/id/:id', 'getArticle');
    })->prefix('\app\blog\controller\v1\Article@');
    // 根据tag_id获取对应的Article_List
});

// BlogSetting
Route::group("v1/blog", function () {
    // 获取配置
    Route::group(function () {
        Route::get('getBlogSetting', 'getBlogSetting');
    })->prefix('\app\blog\controller\v1\BlogSetting@');
    // 获取博主信息
    Route::group(function () {
        Route::get('getBloggerInfo', 'getBloggerInfo');
    })->prefix('\app\blog\controller\v1\BlogSetting@');
});

// Tag
Route::group("v1/blog", function () {
    // 获取配置
    Route::group(function () {
        Route::get('getTagList', 'getTagList');
    })->prefix('\app\blog\controller\v1\Tag@');
});

// ShareUrl
Route::group("v1/blog", function () {
    // 获取配置
    Route::group(function () {
        Route::get('getShareUrl', 'getShareUrl');
    })->prefix('\app\blog\controller\v1\ShareUrl@');
});

// Ad
Route::group("v1/blog", function () {
    // 获取推荐阅读
    Route::group(function () {
        Route::get('recommendedArticle', 'recommendedArticle');
    })->prefix('\app\blog\controller\v1\Ad@');
    // 获取广告列表
    Route::group(function () {
        Route::get('getAdList', 'getAdList');
    })->prefix('\app\blog\controller\v1\Ad@');
    // 打开广告
    Route::group(function () {
        Route::get('adOnClick', 'adOnClick');
    })->prefix('\app\blog\controller\v1\Ad@');
});

// Message
Route::group("v1/blog", function () {
    // 留言
    Route::group(function () {
        Route::post('sentMessage', 'sentMessage');
    })->prefix('\app\blog\controller\v1\Message@');
    // 文章留言列表
    Route::group(function () {
        Route::get('getMessageList', 'getMessageList');
    })->prefix('\app\blog\controller\v1\Message@');
    // 博客留言列表
    Route::group(function () {
        Route::get('getBlogMessageList', 'getBlogMessageList');
    })->prefix('\app\blog\controller\v1\Message@');
});
